CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

include_directories(${COMN_DIR}/include)
include_directories(include)
include_directories(.)
include_directories(rtp)
link_directories(${COMN_DIR}/lib)
link_directories(${THIRD_PARTY}/jrtplib/lib)

if (WIN32)
    include_directories(${THIRD_PARTY}/jrtplib/include/jrtplib3)
    set(LIB_JRTP debug jrtplib_d optimized jrtplib)
else (WIN32)
    include_directories(${THIRD_PARTY}/jrtplib/linux/jrtplib3)
    set(LIB_JRTP jrtp)
endif (WIN32)


aux_source_directory(. SOURCES)
aux_source_directory(./rtp SOURCES)

add_library(RtpCaster SHARED ${SOURCES})

target_link_libraries(RtpCaster
	${LIB_PLATFORM}
	debug comnd optimized comn
	${LIB_JRTP}
	)

set_target_properties(RtpCaster PROPERTIES LINK_INTERFACE_LIBRARIES "")
set_target_properties(RtpCaster PROPERTIES INTERFACE_LINK_LIBRARIES "")

if(CMAKE_TOOLCHAIN_FILE AND EXISTS ${CMAKE_STRIP})
add_custom_command(TARGET RtpCaster
	POST_BUILD
	COMMAND ${CMAKE_STRIP} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libRtpCaster.so
	)
endif()

install(TARGETS RtpCaster DESTINATION .)
